More aggressively 'static'-ize module internal data.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 4 Oct 2005 14:11:17 +0000 (14:11 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 4 Oct 2005 14:11:17 +0000 (14:11 +0000)
32 files changed:
gpsbabel/an1.c
gpsbabel/bcr.c
gpsbabel/cetus.c
gpsbabel/coastexp.c
gpsbabel/copilot.c
gpsbabel/coto.c
gpsbabel/cst.c
gpsbabel/csv_util.c
gpsbabel/csv_util.h
gpsbabel/gcdb.c
gpsbabel/gdb.c
gpsbabel/geo.c
gpsbabel/globals.c
gpsbabel/google.c
gpsbabel/gpilots.c
gpsbabel/gpspilot.c
gpsbabel/gpx.c
gpsbabel/hsa_ndv.c
gpsbabel/ignrando.c
gpsbabel/kml.c
gpsbabel/magnav.c
gpsbabel/magproto.c
gpsbabel/msroute.c
gpsbabel/navicache.c
gpsbabel/nmn5.c
gpsbabel/ozi.c
gpsbabel/pathaway.c
gpsbabel/position.c
gpsbabel/quovadis.c
gpsbabel/tef_xml.c
gpsbabel/tiger.c
gpsbabel/waypt.c

index 7ab321d3fcc19c046515b8a3b69efac2eb1004e9..2de011aa0afa6d3fc841a947df28a2a35fdb7f06 100644 (file)
 #define MYNAME "an1"
 #include "defs.h"
 
-FILE *infile;
-FILE *outfile;
+static FILE *infile;
+static FILE *outfile;
 
 static char *output_type = NULL;
 static char *road_changes = NULL;
 static char *nogc = NULL;
-short output_type_num = 0;
+static short output_type_num = 0;
 
-short last_read_type = 0;
+static short last_read_type = 0;
 
 static long serial=10000;
 static long rtserial=1;
index e1e26a9c3bd4dc4ade5ab4d5547b9486f3521bfc..302cfca3ada531056ec2a3dae4b6145446ec214e 100644 (file)
@@ -46,8 +46,8 @@
 */
 
 static FILE *fin, *fout;
-char *filename;
-int curr_rte_num, target_rte_num;
+static char *filename;
+static int curr_rte_num, target_rte_num;
 static double radius;
 
 /* placeholders for options */
index 7aca01cdc081db1089a3458d5b0632390b7edf28..3596244fbae950d64696dfb4f1acc1c530dced23 100644 (file)
@@ -139,8 +139,8 @@ typedef struct cetus_track_point_s
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 static void *mkshort_wr_handle;
 
 static char *dbname = NULL;
index d3d6b195fceb55f7431b87afdf819303386026ec..4f2d35af5564b1209782749575b60c28c1de9fb9 100755 (executable)
@@ -28,8 +28,8 @@ static XML_Parser psr;
 
 #include "uuid.h"
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 #define MYNAME "coastexp"
 #define MY_CBUF 4096
index 0527c564416ebfcf5c1bfbe56a7d6bf259e7b635..c2828fdadf4ea80cdc79dc6b9415083103780f58 100644 (file)
@@ -41,8 +41,8 @@ struct record {
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 
 static void
 rd_init(const char *fname)
index 7498212b00d9db3f5ffc05c1ad308ee97d2eab1f..9184a0c2be57ffe2430d4e1b124ea32f25ba2118 100644 (file)
@@ -88,7 +88,7 @@ static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
 static const char *in_fname; /* We might need that for naming tracks */
-struct pdb *opdb;
+static struct pdb *opdb;
 
 static char *trackname = NULL;
 static char *zerocat = NULL;
index f3358224275f11d44d410fe80e67bfca3f8702a6..0e11ec8bcb067a4e76656276f32d48d30e0c2ad0 100644 (file)
 #define CST_REFERENCE  4
 #define CST_VERSION    5
 
-static FILE *fin, *fout;
-char *fin_name, *fout_name;
+static FILE *fin;
+static char *fin_name;
 
-route_head *temp_route;
+static route_head *temp_route;
 
 /* placeholders for options */
 
index b7be5ae40c70690c7fc5d80b8466ca7c9bdaae57..78842a794e74631a342272a3eccdb7483ec05f51 100644 (file)
 #define EXCEL_TO_TIMET(a) ((a - 25569.0) * 86400.0)
 #define TIMET_TO_EXCEL(a) ((a / 86400.0) + 25569.0)
 
+
+/****************************************************************************/
+/* obligatory global struct                                                 */
+/****************************************************************************/
+xcsv_file_t xcsv_file = {};
+
 extern char *xcsv_urlbase;
 extern char *prefer_shortnames;
 
index a4d2d421074fd3fda9031d8b421cf89e813ff987..3b5acc735c8bede23e2d6f0c82a2907068bdac3f 100644 (file)
@@ -131,4 +131,4 @@ typedef struct {
 /****************************************************************************/
 /* obligatory global struct                                                 */
 /****************************************************************************/
-xcsv_file_t xcsv_file;
+extern xcsv_file_t xcsv_file;
index f5846882d9c7445f61d7d1d98174a6754060c0d0..df49107d0e4a66e3abc6e777e80f15598b7395ba 100644 (file)
@@ -50,8 +50,8 @@ struct dbrec {
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 
 static char *tbuf = NULL;
 static char *tbufp = NULL;
index e4f0d609041fb066bd01f1bd647d7830514e2615..e72cebab4e0d3e3affeeabfb3efa9828c414efa2 100644 (file)
@@ -73,7 +73,7 @@ typedef enum {
 
 /* %%% local vars %%% */
 
-FILE *fin, *fout;
+static FILE *fin, *fout;
 static char *fin_name, *fout_name;
 
 static int gdb_ver = 1;
index f3b3ddcdb550577c58f1a0be9a1655c9fed49467..5dadf400054b62cfbd58656a332cd4df083bcd30 100644 (file)
@@ -24,8 +24,8 @@ static char *nuke_placer;
 
 static waypoint *wpt_tmp;
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 static
 arglist_t geo_args[] = {
index e2329a9b5445f1a695c5931597f8d5feb0b18afd..2702cc679b62191305bf3ea7f9bdc40633ac624a 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "defs.h"
 
-global_options global_opts;
+global_options global_opts = {};
 const char gpsbabel_version[] = VERSION;
 
 
index 5d14561710f29cf512ef8902001b5b916421fd4c..173417a8a0ca0daabb574d41501278b3369c1147 100644 (file)
@@ -25,7 +25,7 @@ static char *script = NULL;
 static route_head *track_head;
 static void *desc_handle;
 
-FILE *fd;
+static FILE *fd;
 
 static int serial = 0;
 
index ad661de23bffe52f186a0795a738db93a3d778c4..4b1abe6d251d7f830b4cff639a6f8d2bd73ccc75 100644 (file)
@@ -153,8 +153,8 @@ struct record
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 
 static char *dbname = NULL;
 
index 3c28631bc3d2211c5bd4c33590094c4fcb410672..0ab9f1a5da122c0eaadd86e9d9deb1b9209a7ad3 100644 (file)
@@ -48,8 +48,8 @@ struct runways {
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 static char *dbname = NULL;
 
 static
index 01f6a3df8007dcf3bf4adeae7f82a88e21f4c229..09afdabd45effab1ac2ab87c84b76aaed3355256 100644 (file)
@@ -40,7 +40,7 @@ static char *xsi_schema_loc = NULL;
 
 static char *gpx_email = NULL;
 static char *gpx_author = NULL;
-vmem_t current_tag;
+static vmem_t current_tag;
 
 static waypoint *wpt_tmp;
 static int cache_descr_is_html;
index 647f5aa9558f64ea9a9c2ecb7bd990da8764f953..5b3a6811d86960f5ff30d5ed9bd90d4b74b794f4 100644 (file)
@@ -29,7 +29,7 @@ static int in_ChartWork = 0;
 static int in_Object = 0;
 
 static waypoint *wpt_tmp;
-char *routeName = "ROUTENAME";
+static char *routeName = "ROUTENAME";
 
 #define REPLACEMENT_SIRIUS_ATTR_SEPARATOR      ';'
 #define ATTR_USRMRK                                                    "usrmrk"
@@ -38,8 +38,8 @@ char *routeName = "ROUTENAME";
 
 static void readVersion4( FILE* pFile);
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 static
 arglist_t hsa_ndv_args[] = {
index 3e7e2b1e2d763ccee15618e7d9bba8c9258a7380..1b3d233cad989ef6587ad918b30f5fc73aae5076 100644 (file)
@@ -34,7 +34,7 @@ static XML_Parser psr;
 
 #define MYNAME "IGNRando"
 
-FILE *fin, *fout;
+static FILE *fin, *fout;
 
 static route_head *track;
 static waypoint *wpt;
index e71d664754d6a1a7c929ef73cef223ab709d2dfd..6416ea6ad5f49e88876bfe1ba402bc4643749445 100644 (file)
@@ -36,8 +36,8 @@ static int floating;
 
 static waypoint *wpt_tmp;
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 typedef struct {
   double latitude;
index 0e07af7e86f664796497f11703243effecfab776..f60f86f7b72ac5d2e915cd1c8f72748aeb83ff10 100644 (file)
@@ -54,8 +54,8 @@ static FILE *file_out;
 static const char *out_fname;
 static void *mkshort_handle;
 
-struct pdb *opdb;
-struct pdb_record *opdb_rec;
+static struct pdb *opdb;
+static struct pdb_record *opdb_rec;
 
 static void
 rd_init(const char *fname)
index ff234827d530ba7f7f247ce6b5acad9453745a9e..442d3617043f7e617d4e33676e3c4e4fb8edcde2 100644 (file)
@@ -25,9 +25,9 @@
 #include "defs.h"
 #include "magellan.h"
 
-int bitrate = 4800;
-int wptcmtcnt;
-int wptcmtcnt_max;
+static int bitrate = 4800;
+static int wptcmtcnt;
+static int wptcmtcnt_max;
 #define MYNAME "MAGPROTO"
 #define MAXCMTCT 200
 
index ec26e30b1485bc3871860c126e7588a839accf12..9cccb11e7109faa528ad29fe7e730342c57fcdec 100644 (file)
@@ -28,8 +28,8 @@
 
 #undef OLE_DEBUG
 
-FILE *fin;
-char *fin_name;
+static FILE *fin;
+static char *fin_name;
 
 static arglist_t msroute_args[] = 
 {
index a2477749cff5ca9e2593bdcc56c678803b56e460..72ede63e6275a4fb278bbf6338ab4866359dec6c 100644 (file)
@@ -25,8 +25,8 @@ static XML_Parser psr;
 
 static waypoint *wpt_tmp;
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 static char *noretired = NULL;
 
index 9186b6bb5794c50cda70917493d0cdc9f4dc1920..a6d00361f3c117c02c574e4642349563fb07ab29 100644 (file)
@@ -33,7 +33,7 @@
 #define NMN5_MAGIC     0x766d6170              /* vmap */
 #define NMN5_ROUTE     0x49444154              /* IDAT */
 
-FILE *fd_in;
+static FILE *fd_in;
 static struct pdb *pdb_in;
 static char *fname_in;
 
index c6049891a4a714aebb3f5c9e3b57a9bad654e4e1..2de189f10f3ce6cfd129f74b7ac82ceba9e565d8 100644 (file)
@@ -58,7 +58,7 @@ arglist_t ozi_args[] = {
        {0, 0, 0, 0, 0}
 };
 
-gpsdata_type ozi_objective;
+static gpsdata_type ozi_objective;
 
 static char *ozi_ofname = NULL;
 
index dfefb8f4a52548f72d71dadec2b560e5cf7c99fc..3693b206ce4ae859dd732b024df0361ddf9b5ad5 100644 (file)
 #define PPDB_MAGIC_WPT  0x506f4c69             /* PoLi */
 #define PPDB_MAGIC     0x4b6e5772              /* KwNr */
 
-FILE *fd_in, *fd_out;
-struct pdb *pdb_in, *pdb_out;
-char *fname_in, *fname_out;
+static FILE *fd_in, *fd_out;
+static struct pdb *pdb_in, *pdb_out;
+static char *fname_in, *fname_out;
 static void *mkshort_handle;
 static gpsdata_type ppdb_type;
-unsigned char german_release = 0;
+static unsigned char german_release = 0;
 
 typedef struct ppdb_appdata
 {
index 2df410826ae3e885cf97292a01ee331af6c94108..75f0988df275974f1315098f26edc4922a67ee8e 100644 (file)
@@ -38,7 +38,7 @@ static char *nosort = NULL;
 static char *maxctarg = NULL;
 static int maxct;
 
-waypoint * home_pos;
+static waypoint * home_pos;
 
 typedef struct {
        double distance;
index 455d010a0a09ea697134037e3b5b00b6c7d61531..58b7e3b903d90b2b681b7f6faf19cef31954e716 100644 (file)
@@ -24,7 +24,7 @@
 static FILE *file_in;
 static FILE *file_out;
 static const char *out_fname;
-struct pdb *opdb;
+static struct pdb *opdb;
 
 static int ct;
 static ubyte* rec_ptr = NULL;
index 77975d0e0b59fa7be0496ea21ae0e86d6dcd45a2..a2e785981df2fd8e4515ac4353f56dd6bc338800 100644 (file)
@@ -34,8 +34,8 @@ static int waypoints = 0;
 
 static route_head *route = NULL;
 
-FILE *fd;
-FILE *ofd;
+static FILE *fd;
+static FILE *ofd;
 
 static char *routevia = NULL;
 
index a2c398399f2424692f29ed969ad294bf2a874c40..f6d2caa9f217bf81fc78e6d3ab6e5f263cf7b837 100644 (file)
@@ -30,7 +30,7 @@ static void *mkshort_whandle;
 #define MYNAME "GPSUTIL"
 
 static double maxlat, maxlon, minlat, minlon;
-int rec_cnt;
+static int rec_cnt;
 static char *nolabels = NULL;
 static char *genurl = NULL;
 static char *suppresswhite = NULL;
@@ -45,9 +45,9 @@ static char *oldmarker  = NULL;
 static char *newmarker  = NULL;
 static char *unfoundmarker  = NULL;
 
-int scalev;
-int short_length;
-double thresh_days;
+static int scalev;
+static int short_length;
+static double thresh_days;
 
 /*
  *   The code bracketed by CLICKMAP is to generate clickable image maps
index e1daa6d7c422c11f33edd5e3a8a20ee0afb68d8d..bfc1f2b5eb6e2a4b7fa0622f7e679ab0dd7851af 100644 (file)
@@ -23,7 +23,7 @@
 #include "defs.h"
 #include "cet_util.h"
 
-queue waypt_head;
+queue waypt_head = {};
 static unsigned int waypt_ct;
 static void *mkshort_handle;